package com.changgou.item.listener;

import com.changgou.item.service.SearchService;
import com.changgou.search.feign.SearchFeign;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 老大哥在看着你
 *
 * @author ANG.YU
 * @date 2019-10-16 19:03
 */
@Component
public class SpuIsMarketableListener {
    @Autowired
    private SearchService searchService;
    @RabbitListener(queues = "changgouQueue01")
    @RabbitHandler
    public void testListener(String id) {
        System.out.println("======接收到的消息为:======" + id);
        searchService.addSpu(id);
    }
}